From 9665a657b005f3a5b882efff3dd5faeba73297d2 Mon Sep 17 00:00:00 2001 From: rillke Date: Sun, 25 May 2014 13:23:09 +0200 Subject: [PATCH] Add "chemical" major MIME type to the image tables The American Chemical Society suggested a new major MIME type for files containing chemical data in 1998: http://dx.doi.org/10.1021/ci9803233 This suggestion got widely adopted and is now a de-facto-standard despite not registered with IANA. Applying this patch will allow us to continue with extension MolHandler and PDBHandler. http://fab.wmflabs.org/T352 - Fixes bug 66412 by creating a logic that will prevent running unneeded updates. Bug: 66412 Change-Id: Ic45dc1bce796a0406ed8a84e6274df1c4bda4967 --- RELEASE-NOTES-1.24 | 2 + includes/db/Database.php | 33 +++++++++++++--- includes/installer/DatabaseInstaller.php | 39 ++++++++++++++++--- includes/installer/Installer.php | 1 + includes/installer/MssqlUpdater.php | 7 ++++ includes/installer/MysqlUpdater.php | 9 ++++- includes/installer/i18n/en.json | 2 + includes/installer/i18n/qqq.json | 2 + includes/specials/SpecialMIMEsearch.php | 3 +- .../archives/patch-fa_major_mime-chemical.sql | 3 ++ .../patch-img_major_mime-chemical.sql | 3 ++ .../archives/patch-oi_major_mime-chemical.sql | 3 ++ .../archives/patch-fa_major_mime-chemical.sql | 4 ++ .../patch-img_major_mime-chemical.sql | 4 ++ .../archives/patch-oi_major_mime-chemical.sql | 4 ++ maintenance/mssql/tables.sql | 6 +-- maintenance/mssql/update-keys.sql | 31 +++++++++++++++ maintenance/tables.sql | 7 ++-- maintenance/update-keys.sql | 29 ++++++++++++++ 19 files changed, 173 insertions(+), 19 deletions(-) create mode 100644 maintenance/archives/patch-fa_major_mime-chemical.sql create mode 100644 maintenance/archives/patch-img_major_mime-chemical.sql create mode 100644 maintenance/archives/patch-oi_major_mime-chemical.sql create mode 100644 maintenance/mssql/archives/patch-fa_major_mime-chemical.sql create mode 100644 maintenance/mssql/archives/patch-img_major_mime-chemical.sql create mode 100644 maintenance/mssql/archives/patch-oi_major_mime-chemical.sql create mode 100644 maintenance/mssql/update-keys.sql create mode 100644 maintenance/update-keys.sql diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index 7be3139d6a..c2a1e2b70c 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -355,6 +355,8 @@ changes to languages because of Bugzilla reports. * Removed EnhancedChangesList::arrow(), sideArrow(), downArrow(), spacerArrow(). * Removed Xml::namespaceSelector(). (deprecated since 1.19) * Removed WikiPage::estimateRevisionCount(). (deprecated since 1.19) +* MYSQL: Enum item added to "major MIME type" columns. + Running update.php on MySQL < v5.1 may result in heavy processing. ==== Renamed classes ==== * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression diff --git a/includes/db/Database.php b/includes/db/Database.php index 42c94f04b2..a46ee1c068 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -710,19 +710,42 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { } /** - * Return a path to the DBMS-specific schema file, otherwise default to tables.sql + * Return a path to the DBMS-specific SQL file if it exists, + * otherwise default SQL file * + * @param string $filename * @return string */ - public function getSchemaPath() { + private function getSqlFilePath( $filename ) { global $IP; - if ( file_exists( "$IP/maintenance/" . $this->getType() . "/tables.sql" ) ) { - return "$IP/maintenance/" . $this->getType() . "/tables.sql"; + $dbmsSpecificFilePath = "$IP/maintenance/" . $this->getType() . "/$filename"; + if ( file_exists( $dbmsSpecificFilePath ) ) { + return $dbmsSpecificFilePath; } else { - return "$IP/maintenance/tables.sql"; + return "$IP/maintenance/$filename"; } } + /** + * Return a path to the DBMS-specific schema file, + * otherwise default to tables.sql + * + * @return string + */ + public function getSchemaPath() { + return $this->getSqlFilePath( 'tables.sql' ); + } + + /** + * Return a path to the DBMS-specific update key file, + * otherwise default to update-keys.sql + * + * @return string + */ + public function getUpdateKeysPath() { + return $this->getSqlFilePath( 'update-keys.sql' ); + } + # ------------------------------------------------------------------------------ # Other functions # ------------------------------------------------------------------------------ diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 8a01b32b28..31b93c8855 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -163,19 +163,26 @@ abstract class DatabaseInstaller { } /** - * Create database tables from scratch. + * Apply a SQL source file to the database as part of running an installation step. * + * @param string $sourceFileMethod + * @param string $stepName + * @param string $archiveTableMustNotExist * @return Status */ - public function createTables() { + private function stepApplySourceFile( + $sourceFileMethod, + $stepName, + $archiveTableMustNotExist = false + ) { $status = $this->getConnection(); if ( !$status->isOK() ) { return $status; } $this->db->selectDB( $this->getVar( 'wgDBname' ) ); - if ( $this->db->tableExists( 'archive', __METHOD__ ) ) { - $status->warning( 'config-install-tables-exist' ); + if ( $archiveTableMustNotExist && $this->db->tableExists( 'archive', __METHOD__ ) ) { + $status->warning( "config-$stepName-tables-exist" ); $this->enableLB(); return $status; @@ -184,11 +191,13 @@ abstract class DatabaseInstaller { $this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files $this->db->begin( __METHOD__ ); - $error = $this->db->sourceFile( $this->db->getSchemaPath() ); + $error = $this->db->sourceFile( + call_user_func( array( $this->db, $sourceFileMethod ) ) + ); if ( $error !== true ) { $this->db->reportQueryError( $error, 0, '', __METHOD__ ); $this->db->rollback( __METHOD__ ); - $status->fatal( 'config-install-tables-failed', $error ); + $status->fatal( "config-$stepName-tables-failed", $error ); } else { $this->db->commit( __METHOD__ ); } @@ -200,6 +209,24 @@ abstract class DatabaseInstaller { return $status; } + /** + * Create database tables from scratch. + * + * @return Status + */ + public function createTables() { + return $this->stepApplySourceFile( 'getSchemaPath', 'install', true ); + } + + /** + * Insert update keys into table to prevent running unneded updates. + * + * @return Status + */ + public function insertUpdateKeys() { + return $this->stepApplySourceFile( 'getUpdateKeysPath', 'updates', false ); + } + /** * Create the tables for each extension the user enabled * @return Status diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 33b091ba42..aca3119ca8 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1520,6 +1520,7 @@ abstract class Installer { array( 'name' => 'interwiki', 'callback' => array( $installer, 'populateInterwikiTable' ) ), array( 'name' => 'stats', 'callback' => array( $this, 'populateSiteStats' ) ), array( 'name' => 'keys', 'callback' => array( $this, 'generateKeys' ) ), + array( 'name' => 'updates', 'callback' => array( $installer, 'insertUpdateKeys' ) ), array( 'name' => 'sysop', 'callback' => array( $this, 'createSysop' ) ), array( 'name' => 'mainpage', 'callback' => array( $this, 'createMainpage' ) ), ); diff --git a/includes/installer/MssqlUpdater.php b/includes/installer/MssqlUpdater.php index 4d86d116d7..ed11f8b683 100644 --- a/includes/installer/MssqlUpdater.php +++ b/includes/installer/MssqlUpdater.php @@ -52,6 +52,13 @@ class MssqlUpdater extends DatabaseUpdater { array( 'updateConstraints', 'media_type', 'image', 'img_media_type' ), array( 'updateConstraints', 'media_type', 'uploadstash', 'us_media_type' ), // END: Constraint updates + + array( 'modifyField', 'image', 'img_major_mime', + 'patch-img_major_mime-chemical.sql' ), + array( 'modifyField', 'oldimage', 'oi_major_mime', + 'patch-oi_major_mime-chemical.sql' ), + array( 'modifyField', 'filearchive', 'fa_major_mime', + 'patch-fa_major_mime-chemical.sql' ), ); } diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index dcf37b68a3..990b5b031e 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -254,11 +254,18 @@ class MysqlUpdater extends DatabaseUpdater { // 1.24 array( 'addField', 'page_props', 'pp_sortkey', 'patch-pp_sortkey.sql' ), array( 'dropField', 'recentchanges', 'rc_cur_time', 'patch-drop-rc_cur_time.sql' ), - array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp', 'patch-watchlist-user-notificationtimestamp-index.sql' ), + array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp', + 'patch-watchlist-user-notificationtimestamp-index.sql' ), array( 'addField', 'page', 'page_lang', 'patch-page_lang.sql' ), array( 'addField', 'pagelinks', 'pl_from_namespace', 'patch-pl_from_namespace.sql' ), array( 'addField', 'templatelinks', 'tl_from_namespace', 'patch-tl_from_namespace.sql' ), array( 'addField', 'imagelinks', 'il_from_namespace', 'patch-il_from_namespace.sql' ), + array( 'modifyField', 'image', 'img_major_mime', + 'patch-img_major_mime-chemical.sql' ), + array( 'modifyField', 'oldimage', 'oi_major_mime', + 'patch-oi_major_mime-chemical.sql' ), + array( 'modifyField', 'filearchive', 'fa_major_mime', + 'patch-fa_major_mime-chemical.sql' ), ); } diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json index bd76ada1cd..ca328cfee5 100644 --- a/includes/installer/i18n/en.json +++ b/includes/installer/i18n/en.json @@ -306,6 +306,8 @@ "config-install-stats": "Initializing statistics", "config-install-keys": "Generating secret keys", "config-insecure-keys": "Warning: {{PLURAL:$2|A secure key|Secure keys}} ($1) generated during installation {{PLURAL:$2|is|are}} not completely safe. Consider changing {{PLURAL:$2|it|them}} manually.", + "config-install-updates": "Prevent running unneeded updates", + "config-install-updates-failed": "Error: Inserting update keys into tables failed with the following error: $1", "config-install-sysop": "Creating administrator user account", "config-install-subscribe-fail": "Unable to subscribe to mediawiki-announce: $1", "config-install-subscribe-notpossible": "cURL is not installed and allow_url_fopen is not available.", diff --git a/includes/installer/i18n/qqq.json b/includes/installer/i18n/qqq.json index 8d9aac2f0a..410b1d5195 100644 --- a/includes/installer/i18n/qqq.json +++ b/includes/installer/i18n/qqq.json @@ -324,6 +324,8 @@ "config-install-stats": "*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}", "config-install-keys": "*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}", "config-insecure-keys": "Parameters:\n* $1 - A list of names of the secret keys that were generated.\n* $2 - the number of items in the list $1, to be used with PLURAL.", + "config-install-updates": "Message indicating that the updatelog table is filled with keys of updates that won't be run when running database updates.", + "config-install-updates-failed": "Used as error message. Parameters:\n* $1 - detailed error message", "config-install-sysop": "Message indicates that the administrator user account is being created\n\nSee also:\n*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}", "config-install-subscribe-fail": "{{doc-important|\"[[m:mail:mediawiki-announce|mediawiki-announce]]\" is the name of a mailing list and should not be translated.}}\nA message displayed if the MediaWiki installer encounters an error making a request to lists.wikimedia.org which hosts the mailing list.\n* $1 - the HTTP error encountered, reproduced as is (English string)", "config-install-subscribe-notpossible": "Error shown when automatically subscribing to the MediaWiki announcements mailing list fails.", diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php index 3215778862..5bd69e01a8 100644 --- a/includes/specials/SpecialMIMEsearch.php +++ b/includes/specials/SpecialMIMEsearch.php @@ -184,7 +184,8 @@ class MIMEsearchPage extends QueryPage { 'video', 'message', 'model', - 'multipart' + 'multipart', + 'chemical' ); return in_array( $type, $types ); diff --git a/maintenance/archives/patch-fa_major_mime-chemical.sql b/maintenance/archives/patch-fa_major_mime-chemical.sql new file mode 100644 index 0000000000..be9b0ff528 --- /dev/null +++ b/maintenance/archives/patch-fa_major_mime-chemical.sql @@ -0,0 +1,3 @@ +ALTER TABLE /*$wgDBprefix*/filearchive + CHANGE fa_major_mime fa_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical'); + diff --git a/maintenance/archives/patch-img_major_mime-chemical.sql b/maintenance/archives/patch-img_major_mime-chemical.sql new file mode 100644 index 0000000000..4bde446e4f --- /dev/null +++ b/maintenance/archives/patch-img_major_mime-chemical.sql @@ -0,0 +1,3 @@ +ALTER TABLE /*$wgDBprefix*/image + CHANGE img_major_mime img_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical'); + diff --git a/maintenance/archives/patch-oi_major_mime-chemical.sql b/maintenance/archives/patch-oi_major_mime-chemical.sql new file mode 100644 index 0000000000..e3b4552dc7 --- /dev/null +++ b/maintenance/archives/patch-oi_major_mime-chemical.sql @@ -0,0 +1,3 @@ +ALTER TABLE /*$wgDBprefix*/oldimage + CHANGE oi_major_mime oi_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical'); + diff --git a/maintenance/mssql/archives/patch-fa_major_mime-chemical.sql b/maintenance/mssql/archives/patch-fa_major_mime-chemical.sql new file mode 100644 index 0000000000..183680879a --- /dev/null +++ b/maintenance/mssql/archives/patch-fa_major_mime-chemical.sql @@ -0,0 +1,4 @@ +ALTER TABLE /*_*/filearchive +DROP CONSTRAINT fa_major_mime_ckc; +ALTER TABLE /*_*/filearchive +WITH NOCHECK ADD CONSTRAINT fa_major_mime_ckc CHECK (fa_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')); \ No newline at end of file diff --git a/maintenance/mssql/archives/patch-img_major_mime-chemical.sql b/maintenance/mssql/archives/patch-img_major_mime-chemical.sql new file mode 100644 index 0000000000..eed07869cd --- /dev/null +++ b/maintenance/mssql/archives/patch-img_major_mime-chemical.sql @@ -0,0 +1,4 @@ +ALTER TABLE /*_*/image +DROP CONSTRAINT img_major_mime_ckc; +ALTER TABLE /*_*/image +WITH NOCHECK ADD CONSTRAINT img_major_mime_ckc CHECK (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')); \ No newline at end of file diff --git a/maintenance/mssql/archives/patch-oi_major_mime-chemical.sql b/maintenance/mssql/archives/patch-oi_major_mime-chemical.sql new file mode 100644 index 0000000000..35482edcdf --- /dev/null +++ b/maintenance/mssql/archives/patch-oi_major_mime-chemical.sql @@ -0,0 +1,4 @@ +ALTER TABLE /*_*/oldimage +DROP CONSTRAINT oi_major_mime_ckc; +ALTER TABLE /*_*/oldimage +WITH NOCHECK ADD CONSTRAINT oi_major_mime_ckc CHECK (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')); \ No newline at end of file diff --git a/maintenance/mssql/tables.sql b/maintenance/mssql/tables.sql index daaa81eeea..b9cd7159f8 100644 --- a/maintenance/mssql/tables.sql +++ b/maintenance/mssql/tables.sql @@ -594,7 +594,7 @@ CREATE TABLE /*_*/image ( -- SHA-1 content hash in base-36 img_sha1 nvarchar(32) NOT NULL default '', - CONSTRAINT img_major_mime_ckc check (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')), + CONSTRAINT img_major_mime_ckc check (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')), CONSTRAINT img_media_type_ckc check (img_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE')) ); @@ -639,7 +639,7 @@ CREATE TABLE /*_*/oldimage ( oi_deleted tinyint NOT NULL default 0, oi_sha1 nvarchar(32) NOT NULL default '', - CONSTRAINT oi_major_mime_ckc check (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')), + CONSTRAINT oi_major_mime_ckc check (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')), CONSTRAINT oi_media_type_ckc check (oi_media_type IN('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE')) ); @@ -700,7 +700,7 @@ CREATE TABLE /*_*/filearchive ( -- sha1 hash of file content fa_sha1 nvarchar(32) NOT NULL default '', - CONSTRAINT fa_major_mime_ckc check (fa_major_mime in('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')), + CONSTRAINT fa_major_mime_ckc check (fa_major_mime in('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')), CONSTRAINT fa_media_type_ckc check (fa_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE')) ); diff --git a/maintenance/mssql/update-keys.sql b/maintenance/mssql/update-keys.sql new file mode 100644 index 0000000000..4d2c1c1284 --- /dev/null +++ b/maintenance/mssql/update-keys.sql @@ -0,0 +1,31 @@ +-- Update keys for Microsoft SQL Server +-- SQL to insert update keys into the initial tables after a +-- fresh installation of MediaWiki's database. +-- This is read and executed by the install script; you should +-- not have to run it by itself unless doing a manual install. +-- Insert keys here if either the unnecessary would cause heavy +-- processing or could potentially cause trouble by lowering field +-- sizes, adding constraints, etc. +-- When adjusting field sizes, it is recommended removing old +-- patches but to play safe, update keys should also inserted here. + +-- +-- The /*_*/ comments in this and other files are +-- replaced with the defined table prefix by the installer +-- and updater scripts. If you are installing or running +-- updates manually, you will need to manually insert the +-- table prefix if any when running these scripts. +-- + +INSERT INTO /*_*/updatelog + SELECT 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql' AS ul_key, null as ul_value + UNION SELECT 'image-img_major_mime-patch-img_major_mime-chemical.sql', null + UNION SELECT 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql', null + UNION SELECT 'cl_type-category_types-ck', null + UNION SELECT 'fa_major_mime-major_mime-ck', null + UNION SELECT 'fa_media_type-media_type-ck', null + UNION SELECT 'img_major_mime-major_mime-ck', null + UNION SELECT 'img_media_type-media_type-ck', null + UNION SELECT 'oi_major_mime-major_mime-ck', null + UNION SELECT 'oi_media_type-media_type-ck', null + UNION SELECT 'us_media_type-media_type-ck', null; \ No newline at end of file diff --git a/maintenance/tables.sql b/maintenance/tables.sql index f181e0fbdc..0228684849 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -847,7 +847,8 @@ CREATE TABLE /*_*/image ( -- major part of a MIME media type as defined by IANA -- see http://www.iana.org/assignments/media-types/ - img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + -- for "chemical" cf. http://dx.doi.org/10.1021/ci9803233 by the ACS + img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") NOT NULL default "unknown", -- minor part of a MIME media type as defined by IANA -- the minor parts are not required to adher to any standard @@ -906,7 +907,7 @@ CREATE TABLE /*_*/oldimage ( oi_metadata mediumblob NOT NULL, oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, - oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") NOT NULL default "unknown", oi_minor_mime varbinary(100) NOT NULL default "unknown", oi_deleted tinyint unsigned NOT NULL default 0, oi_sha1 varbinary(32) NOT NULL default '' @@ -956,7 +957,7 @@ CREATE TABLE /*_*/filearchive ( fa_metadata mediumblob, fa_bits int default 0, fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, - fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", + fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") default "unknown", fa_minor_mime varbinary(100) default "unknown", fa_description tinyblob, fa_user int unsigned default 0, diff --git a/maintenance/update-keys.sql b/maintenance/update-keys.sql new file mode 100644 index 0000000000..d5ef924d8f --- /dev/null +++ b/maintenance/update-keys.sql @@ -0,0 +1,29 @@ +-- SQL to insert update keys into the initial tables after a +-- fresh installation of MediaWiki's database. +-- This is read and executed by the install script; you should +-- not have to run it by itself unless doing a manual install. +-- Insert keys here if either the unnecessary would cause heavy +-- processing or could potentially cause trouble by lowering field +-- sizes, adding constraints, etc. +-- When adjusting field sizes, it is recommended removing old +-- patches but to play safe, update keys should also inserted here. + +-- This is a shared file used for both MySQL and SQLite installs. +-- Therefore inserting multiple values is not possible using the +-- INSERT INTO VALUES syntax. +-- +-- +-- The /*_*/ comments in this and other files are +-- replaced with the defined table prefix by the installer +-- and updater scripts. If you are installing or running +-- updates manually, you will need to manually insert the +-- table prefix if any when running these scripts. +-- + +INSERT INTO /*_*/updatelog + SELECT 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql' AS ul_key, null as ul_value + UNION SELECT 'image-img_major_mime-patch-img_major_mime-chemical.sql', null + UNION SELECT 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql', null + UNION SELECT 'user_groups-ug_group-patch-ug_group-length-increase-255.sql', null + UNION SELECT 'user_former_groups-ufg_group-patch-ufg_group-length-increase-255.sql', null + UNION SELECT 'user_properties-up_property-patch-up_property.sql', null; \ No newline at end of file -- 2.20.1